<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ include file="/page/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<%@ include file="/adapter/adapter-bootstrap.jsp" %>
<script type="text/javascript" src="res/common/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript">  
var paramvalue="";
  function saveParam(appid,moduleid,paramcode){
	    $.ajax({
	        url: "${ctx}/appModuleParam/updateAppModuleParam?appid="+appid+"&moduleid="+moduleid+"&paramcode="+paramcode+"&paramvalue="+paramvalue,
	        type: "POST",      
	        dataType:"json",
	        async: false,
	        success: function(data) {
				document.getElementById('edit').style.display = "none";
	        	if(data.flag=='1'){
		            alert("修改成功！");	
	        	}

/* 	          $.each(data, function(index, element) {
	             window.location.reload();
	          }); */
	        },
	        error: function() {
			  document.getElementById('edit').style.display = "none";
	          alert("error");
	        }
	      });
  }
  
	$('#paramValue').dblclick(function () {
		this.readOnly = false;
		//document.getElementById('edit').style.display = "block";
		$('#edit').show();
		//$('#paramValue').attr("readonly",true);

	}); 
	
	function getParamValue(pvalue){
		paramvalue=pvalue;
		//$('#edit').hide();
	}
</script>
</head>
<body>
<div class="panel panel-default">
   <div class="panel-heading">
      <h3 class="panel-title">
          App模块参数列表信息
      </h3>
   </div>
   <div class="panel-body">
   		<form id="dataListForm" method="post"  action="${ctx}/appFrameModule1/appFrameModuleList1">
			<br>		
			<table class="table table-bordered" style="" width="100%" cellspacing="1" cellpadding="0" border="0">
				<thead>
					<tr>
						<th>应用标识</th>
						<th>模块标识</th>
						<th>参数代码</th>
						<th>参数名称</th>
						<th>是否必输</th>
						<th>参数值</th>
					</tr>
				</thead>				
				<tbody>
				<c:forEach items="${paramList}" var="moduleParam"  varStatus="s" >
				        <tr align="center" class="row_module" id="${module.moduleId}" >
							<td>${moduleParam.appId}</td>
							<td>${moduleParam.moduleId}</td>
							<td>${moduleParam.paramCode}</td>
							<td>${moduleParam.paramName}</td>
			<c:if test="${moduleParam.isMustNeed==1}">
                <td>是</td>       
            </c:if>
            <c:if test="${moduleParam.isMustNeed==2}">
                <td>否</td>        
            </c:if>
							<td>
							<input type="text" class="form-control" id="paramValue"  value="${moduleParam.paramValue}"  name="commTimeout"  onblur="getParamValue(this.value)" readOnly   placeholder="comm_timeout"/>
							<input type="button" style="display:none" id="edit" value="修改" onclick="saveParam('${moduleParam.appId}','${moduleParam.moduleId}','${moduleParam.paramCode}')">
							</td>
						</tr>  				
				</c:forEach>													
				</tbody>
			</table>
		</form>
   </div>
</div>
<%@ include file="/page/foot.html" %>
